#ifndef GRAPHICSLINEITEM_H
#define GRAPHICSLINEITEM_H

#include "GraphicsItem.h"

class QUINCE_SCENE_EXPORT GraphicsLineItem : public GraphicsItem
{
    Q_OBJECT
    Q_PROPERTY(QPointF head READ head WRITE setHead NOTIFY headChanged)
    Q_PROPERTY(QPointF tail READ tail WRITE setTail NOTIFY tailChanged)
public:
    GraphicsLineItem();
    virtual ~GraphicsLineItem();

    QLineF line() const { return QLineF(m_p1, m_p2); }
    void setLine(const QPointF &p1, const QPointF &p2);
    void setLine(const QLineF &ln);


    QPointF head() const { return m_p1; }
    QPointF tail() const { return m_p2; }

    void setHead(const QPointF &h);
    void setTail(const QPointF &t);


    virtual void render();

signals:
    void headChanged(const QPointF &);
    void tailChanged(const QPointF &);

private:
    QPointF m_p1;
    QPointF m_p2;
};

#endif // GRAPHICSLINEITEM_H
